package com.jingtao.product.service.impl;

import com.jingtao.product.domain.Brand;
import com.jingtao.product.domain.vo.BrandVo;
import com.jingtao.product.mapper.BrandMapper;
import com.jingtao.product.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName:
 * @Description:
 * @Author: zengfanzhen
 * @Date: 2024/3/28 22:23:37
 */
@Service
public class BrandServiceImpl implements BrandService {

    @Autowired
    private BrandMapper brandMapper;

    @Override
    public List<Brand> getBrandList() {
        return brandMapper.getBrandList();
    }

    /**
     * @param brandVo
     * @return 条件查询 品牌信息
     * @Param [brandVo]
     **/
    @Override
    public List<Brand> queryBrandList(BrandVo brandVo) {
        return brandMapper.queryBrandList(brandVo);
    }

    /**
     * 查询商品品牌
     *
     * @param id 商品品牌主键
     * @return 商品品牌
     */
    @Override
    public Brand selectBrandById(Long id)
    {
        return brandMapper.selectBrandById(id);
    }

    /**
     * 新增商品品牌
     *
     * @param brand 商品品牌
     * @return 结果
     */
    @Override
    public int insertBrand(Brand brand)
    {
        return brandMapper.insertBrand(brand);
    }

    /**
     * 修改商品品牌
     *
     * @param brand 商品品牌
     * @return 结果
     */
    @Override
    public int updateBrand(Brand brand)
    {
        return brandMapper.updateBrand(brand);
    }

    /**
     * 批量删除商品品牌
     *
     * @param ids 需要删除的商品品牌主键
     * @return 结果
     */
    @Override
    public int deleteBrandByIds(Long[] ids)
    {
        return brandMapper.deleteBrandByIds(ids);
    }

    /**
     * 删除商品品牌信息
     *
     * @param id 商品品牌主键
     * @return 结果
     */
    @Override
    public int deleteBrandById(Long id)
    {
        return brandMapper.deleteBrandById(id);
    }
}
